package lumis.content.workflow;

import lumis.portal.PortalException;
import lumis.portal.dao.hibernate.GenericHibernateManualUpdateDao;
import lumis.util.ITransaction;

/**
 * @version $Revision: 6669 $ $Date: 2007-05-02 15:52:18 -0300 (Wed, 02 May 2007) $
 * @since 4.0.0
 */
class WorkflowDaoHib extends WorkflowDaoJdbc implements IWorkflowDao
{
	private static class WorkflowDao extends GenericHibernateManualUpdateDao<WorkflowConfig, String>
	{
		public WorkflowDao()
		{
			super(WorkflowConfig.class);
		}
		
		protected String getIdentifier(WorkflowConfig workflowConfig)
		{
			return workflowConfig.getId();
		}
		
		public void add(WorkflowConfig workflowConfig, ITransaction transaction) throws PortalException
		{
			super.add(workflowConfig, transaction);
		}
		
		public void update(WorkflowConfig workflowConfig, ITransaction transaction) throws PortalException
		{
			super.update(workflowConfig, transaction);
		}

		public WorkflowConfig get(String workflowId, ITransaction transaction) throws PortalException
		{
			return super.get(workflowId, transaction);
		}
		
		public boolean delete(String workflowId, ITransaction transaction) throws PortalException
		{
			return super.delete(workflowId, transaction);
		}		
	}
	
	private WorkflowDao workflowDao = new WorkflowDao();

	public void add(WorkflowConfig workflowConfig, ITransaction transaction) throws PortalException
	{
		workflowDao.add(workflowConfig, transaction);
	}
	
	public void update(WorkflowConfig workflowConfig, ITransaction transaction) throws PortalException
	{
		workflowDao.update(workflowConfig, transaction);
	}
	
	public boolean delete(String workflowId, ITransaction transaction) throws PortalException
	{
		return workflowDao.delete(workflowId, transaction);

	}
	public WorkflowConfig get(String workflowId, ITransaction daoTransaction) throws PortalException
	{
		return workflowDao.get(workflowId, daoTransaction);

	}	
}
